package br.com.localfloripa.dao;

import java.util.List;

import javax.inject.Named;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;

import br.com.localfloripa.entities.Perfil;

@Named("perfilDao")
@Scope("singleton")
public class PerfilDao extends DaoManager<Perfil> {
	
	
	private static final Logger log = LoggerFactory.getLogger(PerfilDao.class);
	
	public Perfil findById(Long idPerfil) throws Exception {
		return em.find(Perfil.class, idPerfil);
	}
	
	public List<Perfil> listAllPerfis() throws Exception {
		return em.createQuery("SELECT p FROM Perfil p").getResultList();
	}

}
